<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>InfXmppConnection</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.0">
<link rel="home" href="index.html" title="libinfinity-0.4 Reference Manual">
<link rel="up" href="ch02.html" title="Common libinfinity API">
<link rel="prev" href="InfXmlConnection.html" title="InfXmlConnection">
<link rel="next" href="InfSimulatedConnection.html" title="InfSimulatedConnection">
<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="InfXmlConnection.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch02.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">libinfinity-0.4 Reference Manual</th>
<td><a accesskey="n" href="InfSimulatedConnection.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#InfXmppConnection.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#InfXmppConnection.description" class="shortcut">Description</a>
                   | 
                  <a href="#InfXmppConnection.object-hierarchy" class="shortcut">Object Hierarchy</a>
                   | 
                  <a href="#InfXmppConnection.implemented-interfaces" class="shortcut">Implemented Interfaces</a>
                   | 
                  <a href="#InfXmppConnection.properties" class="shortcut">Properties</a>
</td></tr>
</table>
<div class="refentry" title="InfXmppConnection">
<a name="InfXmppConnection"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="InfXmppConnection.top_of_page"></a>InfXmppConnection</span></h2>
<p>InfXmppConnection</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="InfXmppConnection.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis"><span class="returnvalue">void</span>                (<a class="link" href="InfXmppConnection.html#InfXmppConnectionCrtCallback" title="InfXmppConnectionCrtCallback ()">*InfXmppConnectionCrtCallback</a>)     (<em class="parameter"><code><a class="link" href="InfXmppConnection.html" title="InfXmppConnection"><span class="type">InfXmppConnection</span></a> *xmpp</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain"><span class="type">InfCertificateChain</span></a> *chain</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
enum                <a class="link" href="InfXmppConnection.html#InfXmppConnectionSite" title="enum InfXmppConnectionSite">InfXmppConnectionSite</a>;
enum                <a class="link" href="InfXmppConnection.html#InfXmppConnectionSecurityPolicy" title="enum InfXmppConnectionSecurityPolicy">InfXmppConnectionSecurityPolicy</a>;
enum                <a class="link" href="InfXmppConnection.html#InfXmppConnectionError" title="enum InfXmppConnectionError">InfXmppConnectionError</a>;
enum                <a class="link" href="InfXmppConnection.html#InfXmppConnectionStreamError" title="enum InfXmppConnectionStreamError">InfXmppConnectionStreamError</a>;
enum                <a class="link" href="InfXmppConnection.html#InfXmppConnectionAuthError" title="enum InfXmppConnectionAuthError">InfXmppConnectionAuthError</a>;
                    <a class="link" href="InfXmppConnection.html#InfXmppConnection-struct" title="InfXmppConnection">InfXmppConnection</a>;
                    <a class="link" href="InfXmppConnection.html#InfXmppConnectionClass" title="InfXmppConnectionClass">InfXmppConnectionClass</a>;
<a class="link" href="InfXmppConnection.html" title="InfXmppConnection"><span class="returnvalue">InfXmppConnection</span></a> * <a class="link" href="InfXmppConnection.html#inf-xmpp-connection-new" title="inf_xmpp_connection_new ()">inf_xmpp_connection_new</a>             (<em class="parameter"><code><a class="link" href="InfTcpConnection.html" title="InfTcpConnection"><span class="type">InfTcpConnection</span></a> *tcp</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfXmppConnection.html#InfXmppConnectionSite" title="enum InfXmppConnectionSite"><span class="type">InfXmppConnectionSite</span></a> site</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *local_hostname</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *remote_hostname</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfXmppConnection.html#InfXmppConnectionSecurityPolicy" title="enum InfXmppConnectionSecurityPolicy"><span class="type">InfXmppConnectionSecurityPolicy</span></a> security_policy</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libinfinity-0.4-InfCertificateCredentials.html#InfCertificateCredentials" title="InfCertificateCredentials"><span class="type">InfCertificateCredentials</span></a> *creds</code></em>,
                                                         <em class="parameter"><code><span class="type">Gsasl</span> *sasl_context</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *sasl_mechanisms</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="InfXmppConnection.html#inf-xmpp-connection-get-tls-enabled" title="inf_xmpp_connection_get_tls_enabled ()">inf_xmpp_connection_get_tls_enabled</a> (<em class="parameter"><code><a class="link" href="InfXmppConnection.html" title="InfXmppConnection"><span class="type">InfXmppConnection</span></a> *xmpp</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="InfXmppConnection.html#inf-xmpp-connection-set-certificate-callback" title="inf_xmpp_connection_set_certificate_callback ()">inf_xmpp_connection_set_certificate_callback</a>
                                                        (<em class="parameter"><code><a class="link" href="InfXmppConnection.html" title="InfXmppConnection"><span class="type">InfXmppConnection</span></a> *xmpp</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfXmppConnection.html#InfXmppConnectionCrtCallback" title="InfXmppConnectionCrtCallback ()"><span class="type">InfXmppConnectionCrtCallback</span></a> cb</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="InfXmppConnection.html#inf-xmpp-connection-certificate-verify-continue" title="inf_xmpp_connection_certificate_verify_continue ()">inf_xmpp_connection_certificate_verify_continue</a>
                                                        (<em class="parameter"><code><a class="link" href="InfXmppConnection.html" title="InfXmppConnection"><span class="type">InfXmppConnection</span></a> *xmpp</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="InfXmppConnection.html#inf-xmpp-connection-certificate-verify-cancel" title="inf_xmpp_connection_certificate_verify_cancel ()">inf_xmpp_connection_certificate_verify_cancel</a>
                                                        (<em class="parameter"><code><a class="link" href="InfXmppConnection.html" title="InfXmppConnection"><span class="type">InfXmppConnection</span></a> *xmpp</code></em>);
</pre>
</div>
<div class="refsect1" title="Object Hierarchy">
<a name="InfXmppConnection.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
   +----InfXmppConnection
</pre>
</div>
<div class="refsect1" title="Implemented Interfaces">
<a name="InfXmppConnection.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
<p>
InfXmppConnection implements
 <a class="link" href="InfXmlConnection.html" title="InfXmlConnection">InfXmlConnection</a>.</p>
</div>
<div class="refsect1" title="Properties">
<a name="InfXmppConnection.properties"></a><h2>Properties</h2>
<pre class="synopsis">
  "<a class="link" href="InfXmppConnection.html#InfXmppConnection--credentials" title='The "credentials" property'>credentials</a>"              <a class="link" href="libinfinity-0.4-InfCertificateCredentials.html#InfCertificateCredentials" title="InfCertificateCredentials"><span class="type">InfCertificateCredentials</span></a>*  : Read / Write / Construct Only
  "<a class="link" href="InfXmppConnection.html#InfXmppConnection--local-hostname" title='The "local-hostname" property'>local-hostname</a>"           <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>*                : Read / Write / Construct Only
  "<a class="link" href="InfXmppConnection.html#InfXmppConnection--remote-hostname" title='The "remote-hostname" property'>remote-hostname</a>"          <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>*                : Read / Write / Construct Only
  "<a class="link" href="InfXmppConnection.html#InfXmppConnection--sasl-context" title='The "sasl-context" property'>sasl-context</a>"             <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>              : Read / Write / Construct Only
  "<a class="link" href="InfXmppConnection.html#InfXmppConnection--sasl-mechanisms" title='The "sasl-mechanisms" property'>sasl-mechanisms</a>"          <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>*                : Read / Write / Construct Only
  "<a class="link" href="InfXmppConnection.html#InfXmppConnection--security-policy" title='The "security-policy" property'>security-policy</a>"          <a class="link" href="InfXmppConnection.html#InfXmppConnectionSecurityPolicy" title="enum InfXmppConnectionSecurityPolicy"><span class="type">InfXmppConnectionSecurityPolicy</span></a>  : Read / Write / Construct Only
  "<a class="link" href="InfXmppConnection.html#InfXmppConnection--site" title='The "site" property'>site</a>"                     <a class="link" href="InfXmppConnection.html#InfXmppConnectionSite" title="enum InfXmppConnectionSite"><span class="type">InfXmppConnectionSite</span></a>  : Read / Write / Construct Only
  "<a class="link" href="InfXmppConnection.html#InfXmppConnection--tcp-connection" title='The "tcp-connection" property'>tcp-connection</a>"           <a class="link" href="InfTcpConnection.html" title="InfTcpConnection"><span class="type">InfTcpConnection</span></a>*     : Read / Write / Construct Only
  "<a class="link" href="InfXmppConnection.html#InfXmppConnection--tls-enabled" title='The "tls-enabled" property'>tls-enabled</a>"              <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>              : Read
</pre>
</div>
<div class="refsect1" title="Description">
<a name="InfXmppConnection.description"></a><h2>Description</h2>
<p>
</p>
</div>
<div class="refsect1" title="Details">
<a name="InfXmppConnection.details"></a><h2>Details</h2>
<div class="refsect2" title="InfXmppConnectionCrtCallback ()">
<a name="InfXmppConnectionCrtCallback"></a><h3>InfXmppConnectionCrtCallback ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                (*InfXmppConnectionCrtCallback)     (<em class="parameter"><code><a class="link" href="InfXmppConnection.html" title="InfXmppConnection"><span class="type">InfXmppConnection</span></a> *xmpp</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain"><span class="type">InfCertificateChain</span></a> *chain</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>xmpp</code></em> :</span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>chain</code></em> :</span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="enum InfXmppConnectionSite">
<a name="InfXmppConnectionSite"></a><h3>enum InfXmppConnectionSite</h3>
<pre class="programlisting">typedef enum _InfXmppConnectionSite {
  INF_XMPP_CONNECTION_SERVER,
  INF_XMPP_CONNECTION_CLIENT
} InfXmppConnectionSite;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" title="enum InfXmppConnectionSecurityPolicy">
<a name="InfXmppConnectionSecurityPolicy"></a><h3>enum InfXmppConnectionSecurityPolicy</h3>
<pre class="programlisting">typedef enum _InfXmppConnectionSecurityPolicy {
  /* Server: Do not offer TLS.
   * Client: Only connect if TLS is not required. */
  INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED,
  /* Server: Require TLS.
   * Client: Only connect if TLS is available. */
  INF_XMPP_CONNECTION_SECURITY_ONLY_TLS,
  /* Server: Offer both.
   * Client: Use unsecured communication unless TLS is required */
  INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_UNSECURED,
  /* Server: Offer both.
   * Client: Use TLS-secured communication unless TLS is not available. */
  INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_TLS
} InfXmppConnectionSecurityPolicy;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" title="enum InfXmppConnectionError">
<a name="InfXmppConnectionError"></a><h3>enum InfXmppConnectionError</h3>
<pre class="programlisting">typedef enum _InfXmppConnectionError {
  /* Server does not support TLS */
  INF_XMPP_CONNECTION_ERROR_TLS_UNSUPPORTED,
  /* The server requires TLS, but we don't want TLS */
  INF_XMPP_CONNECTION_ERROR_TLS_REQUIRED,
  /* Got &lt;failure&gt; as response to &lt;starttls&gt; */
  INF_XMPP_CONNECTION_ERROR_TLS_FAILURE,
  /* The server did not provide a certificate */
  INF_XMPP_CONNECTION_ERROR_NO_CERTIFICATE_PROVIDED,
  /* The server certificate is not trusted */
  INF_XMPP_CONNECTION_ERROR_CERTIFICATE_NOT_TRUSTED,
  /* Server does not provide authentication mechanisms */
  INF_XMPP_CONNECTION_ERROR_AUTHENTICATION_UNSUPPORTED,
  /* Server does not offer a suitable machnism */
  INF_XMPP_CONNECTION_ERROR_NO_SUITABLE_MECHANISM,

  INF_XMPP_CONNECTION_ERROR_FAILED
} InfXmppConnectionError;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" title="enum InfXmppConnectionStreamError">
<a name="InfXmppConnectionStreamError"></a><h3>enum InfXmppConnectionStreamError</h3>
<pre class="programlisting">typedef enum _InfXmppConnectionStreamError {
  INF_XMPP_CONNECTION_STREAM_ERROR_BAD_FORMAT,
  INF_XMPP_CONNECTION_STREAM_ERROR_BAD_NAMESPACE_PREFIX,
  INF_XMPP_CONNECTION_STREAM_ERROR_CONFLICT,
  INF_XMPP_CONNECTION_STREAM_ERROR_CONNECTION_TIMEOUT,
  INF_XMPP_CONNECTION_STREAM_ERROR_HOST_GONE,
  INF_XMPP_CONNECTION_STREAM_ERROR_HOST_UNKNOWN,
  INF_XMPP_CONNECTION_STREAM_ERROR_IMPROPER_ADDRESSING,
  INF_XMPP_CONNECTION_STREAM_ERROR_INTERNAL_SERVER_ERROR,
  INF_XMPP_CONNECTION_STREAM_ERROR_INVALID_FROM,
  INF_XMPP_CONNECTION_STREAM_ERROR_INVALID_ID,
  INF_XMPP_CONNECTION_STREAM_ERROR_INVALID_NAMESPACE,
  INF_XMPP_CONNECTION_STREAM_ERROR_INVALID_XML,
  INF_XMPP_CONNECTION_STREAM_ERROR_NOT_AUTHORIZED,
  INF_XMPP_CONNECTION_STREAM_ERROR_POLICY_VIOLATION,
  INF_XMPP_CONNECTION_STREAM_ERROR_REMOTE_CONNECTION_FAILED,
  INF_XMPP_CONNECTION_STREAM_ERROR_RESOURCE_CONSTRAINT,
  INF_XMPP_CONNECTION_STREAM_ERROR_RESTRICTED_XML,
  INF_XMPP_CONNECTION_STREAM_ERROR_SEE_OTHER_HOST,
  INF_XMPP_CONNECTION_STREAM_ERROR_SYSTEM_SHUTDOWN,
  INF_XMPP_CONNECTION_STREAM_ERROR_UNDEFINED_CONDITION,
  INF_XMPP_CONNECTION_STREAM_ERROR_UNSUPPORTED_ENCODING,
  INF_XMPP_CONNECTION_STREAM_ERROR_UNSUPPORTED_STANZA_TYPE,
  INF_XMPP_CONNECTION_STREAM_ERROR_UNSUPPORTED_VERSION,
  INF_XMPP_CONNECTION_STREAM_ERROR_XML_NOT_WELL_FORMED,

  INF_XMPP_CONNECTION_STREAM_ERROR_FAILED
} InfXmppConnectionStreamError;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" title="enum InfXmppConnectionAuthError">
<a name="InfXmppConnectionAuthError"></a><h3>enum InfXmppConnectionAuthError</h3>
<pre class="programlisting">typedef enum _InfXmppConnectionAuthError {
  INF_XMPP_CONNECTION_AUTH_ERROR_ABORTED,
  INF_XMPP_CONNECTION_AUTH_ERROR_INCORRECT_ENCODING,
  INF_XMPP_CONNECTION_AUTH_ERROR_INVALID_AUTHZID,
  INF_XMPP_CONNECTION_AUTH_ERROR_INVALID_MECHANISM,
  INF_XMPP_CONNECTION_AUTH_ERROR_MECHANISM_TOO_WEAK,
  INF_XMPP_CONNECTION_AUTH_ERROR_NOT_AUTHORIZED,
  INF_XMPP_CONNECTION_AUTH_ERROR_TEMPORARY_AUTH_FAILURE,

  INF_XMPP_CONNECTION_AUTH_ERROR_FAILED
} InfXmppConnectionAuthError;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" title="InfXmppConnection">
<a name="InfXmppConnection-struct"></a><h3>InfXmppConnection</h3>
<pre class="programlisting">typedef struct _InfXmppConnection InfXmppConnection;</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" title="InfXmppConnectionClass">
<a name="InfXmppConnectionClass"></a><h3>InfXmppConnectionClass</h3>
<pre class="programlisting">typedef struct {
  GObjectClass parent_class;
} InfXmppConnectionClass;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" title="inf_xmpp_connection_new ()">
<a name="inf-xmpp-connection-new"></a><h3>inf_xmpp_connection_new ()</h3>
<pre class="programlisting"><a class="link" href="InfXmppConnection.html" title="InfXmppConnection"><span class="returnvalue">InfXmppConnection</span></a> * inf_xmpp_connection_new             (<em class="parameter"><code><a class="link" href="InfTcpConnection.html" title="InfTcpConnection"><span class="type">InfTcpConnection</span></a> *tcp</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfXmppConnection.html#InfXmppConnectionSite" title="enum InfXmppConnectionSite"><span class="type">InfXmppConnectionSite</span></a> site</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *local_hostname</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *remote_hostname</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfXmppConnection.html#InfXmppConnectionSecurityPolicy" title="enum InfXmppConnectionSecurityPolicy"><span class="type">InfXmppConnectionSecurityPolicy</span></a> security_policy</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libinfinity-0.4-InfCertificateCredentials.html#InfCertificateCredentials" title="InfCertificateCredentials"><span class="type">InfCertificateCredentials</span></a> *creds</code></em>,
                                                         <em class="parameter"><code><span class="type">Gsasl</span> *sasl_context</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *sasl_mechanisms</code></em>);</pre>
<p>
Creates a new <a class="link" href="InfXmppConnection.html" title="InfXmppConnection"><span class="type">InfXmppConnection</span></a> with <em class="parameter"><code>tcp</code></em> as communication channel. No
attempt is being made to open <em class="parameter"><code>tcp</code></em>, if it is not already open. However,
communication is initiated as soon as <em class="parameter"><code>tcp</code></em> gets into
<code class="literal">INF_TCP_CONNECTION_CONNECTED</code> state, so you might still open it
lateron yourself.
</p>
<p>
<em class="parameter"><code>local_hostname</code></em> specifies the hostname of the local host, and
<em class="parameter"><code>remote_hostname</code></em> specifies the hostname of the remote host, as known to
the caller. These can be a string representation of the IP address of
<em class="parameter"><code>tcp</code></em>, or a DNS name such as "example.com". <em class="parameter"><code>local_hostname</code></em> can be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
in which case the host name as reported by <a href="http://library.gnome.org/devel/glib/unstable/glib-Miscellaneous-Utility-Functions.html#g-get-host-name"><code class="function">g_get_host_name()</code></a> is used.
</p>
<p>
<em class="parameter"><code>creds</code></em> may be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> in which case the connection creates the credentials
as soon as they are required. However, this only works if
<em class="parameter"><code>site</code></em> is <code class="literal">INF_XMPP_CONNECTION_CLIENT</code> or <em class="parameter"><code>security_policy</code></em> is
<code class="literal">INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED</code> (or both, of course). For
server connections <em class="parameter"><code>creds</code></em> must contain a valid server certificate in case
<em class="parameter"><code>security_policy</code></em> is not <code class="literal">INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED</code>.
</p>
<p>
If <em class="parameter"><code>sasl_context</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, <a class="link" href="InfXmppConnection.html" title="InfXmppConnection"><span class="type">InfXmppConnection</span></a> uses a built-in context
that only supports ANONYMOUS authentication. In the <em class="parameter"><code>sasl_context</code></em>'s
callback function, the <a class="link" href="InfXmppConnection.html" title="InfXmppConnection"><span class="type">InfXmppConnection</span></a> for which the authentication
shall be performed can be retrieved with <code class="function">gsasl_session_hook_get()</code>.
</p>
<p>
If <em class="parameter"><code>sasl_context</code></em> is not <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, then the <em class="parameter"><code>sasl_mechanisms</code></em> parameter defines
what SASL mechanisms are used. On the server side, these are the mechanisms
offered to the client, and on the client side, these are the accepted
mechanisms (meaning that if a server does not offer any of these, the
connection will be closed). If <em class="parameter"><code>sasl_context</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, then this parameter
is ignored. <em class="parameter"><code>sasl_mechanisms</code></em> can be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> in which case all available
mechanisms are accepted or offered, respectively.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>tcp</code></em> :</span></p></td>
<td>The underlaying TCP connection to use.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>site</code></em> :</span></p></td>
<td>Whether this is a XMPP client or server.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>local_hostname</code></em> :</span></p></td>
<td>The hostname of the local host, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>remote_hostname</code></em> :</span></p></td>
<td>The hostname of the remote host.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>security_policy</code></em> :</span></p></td>
<td>Whether to use (or offer, as a server) TLS. See
<a class="link" href="InfXmppConnection.html#InfXmppConnectionSecurityPolicy" title="enum InfXmppConnectionSecurityPolicy"><span class="type">InfXmppConnectionSecurityPolicy</span></a> for the meaning of this parameter.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>creds</code></em> :</span></p></td>
<td>Certificate credentials used to secure the communication.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sasl_context</code></em> :</span></p></td>
<td>A SASL context used for authentication.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sasl_mechanisms</code></em> :</span></p></td>
<td>A whitespace-separated list of SASL mechanisms to
accept/offer, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A new <a class="link" href="InfXmppConnection.html" title="InfXmppConnection"><span class="type">InfXmppConnection</span></a>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_xmpp_connection_get_tls_enabled ()">
<a name="inf-xmpp-connection-get-tls-enabled"></a><h3>inf_xmpp_connection_get_tls_enabled ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            inf_xmpp_connection_get_tls_enabled (<em class="parameter"><code><a class="link" href="InfXmppConnection.html" title="InfXmppConnection"><span class="type">InfXmppConnection</span></a> *xmpp</code></em>);</pre>
<p>
Returns whether TLS encryption is enabled for <em class="parameter"><code>xmpp</code></em>. This returns <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>
as soon as the TLS handshake is completed but before the server certificate
was verified (see <a class="link" href="InfXmppConnection.html#inf-xmpp-connection-set-certificate-callback" title="inf_xmpp_connection_set_certificate_callback ()"><code class="function">inf_xmpp_connection_set_certificate_callback()</code></a>).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>xmpp</code></em> :</span></p></td>
<td>A <a class="link" href="InfXmppConnection.html" title="InfXmppConnection"><span class="type">InfXmppConnection</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if TLS is enabled and <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_xmpp_connection_set_certificate_callback ()">
<a name="inf-xmpp-connection-set-certificate-callback"></a><h3>inf_xmpp_connection_set_certificate_callback ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                inf_xmpp_connection_set_certificate_callback
                                                        (<em class="parameter"><code><a class="link" href="InfXmppConnection.html" title="InfXmppConnection"><span class="type">InfXmppConnection</span></a> *xmpp</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfXmppConnection.html#InfXmppConnectionCrtCallback" title="InfXmppConnectionCrtCallback ()"><span class="type">InfXmppConnectionCrtCallback</span></a> cb</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>
This function sets a callback that is called when the connection needs to
verify the server's certificate. It does not need to respond immediately,
but can, for example, show a dialog to a user and continue when the user
finished with it.
</p>
<p>
When the certificate is trusted, then call
<a class="link" href="InfXmppConnection.html#inf-xmpp-connection-certificate-verify-continue" title="inf_xmpp_connection_certificate_verify_continue ()"><code class="function">inf_xmpp_connection_certificate_verify_continue()</code></a>,
otherwise <a class="link" href="InfXmppConnection.html#inf-xmpp-connection-certificate-verify-cancel" title="inf_xmpp_connection_certificate_verify_cancel ()"><code class="function">inf_xmpp_connection_certificate_verify_cancel()</code></a>. This can happen
in the callback or some time later. The connection process is stopped until
either of these functions is called.
</p>
<p>
If <em class="parameter"><code>cb</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, or this function has not been called before a certificate
needs to be verified, then the certificate is always trusted.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>xmpp</code></em> :</span></p></td>
<td>A <a class="link" href="InfXmppConnection.html" title="InfXmppConnection"><span class="type">InfXmppConnection</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cb</code></em> :</span></p></td>
<td>Function to be called to verify the server certificate, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>Additional data to pass to the callback function.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_xmpp_connection_certificate_verify_continue ()">
<a name="inf-xmpp-connection-certificate-verify-continue"></a><h3>inf_xmpp_connection_certificate_verify_continue ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                inf_xmpp_connection_certificate_verify_continue
                                                        (<em class="parameter"><code><a class="link" href="InfXmppConnection.html" title="InfXmppConnection"><span class="type">InfXmppConnection</span></a> *xmpp</code></em>);</pre>
<p>
Call this function when your callback set in
<a class="link" href="InfXmppConnection.html#inf-xmpp-connection-set-certificate-callback" title="inf_xmpp_connection_set_certificate_callback ()"><code class="function">inf_xmpp_connection_set_certificate_callback()</code></a> was called and you do trust
the server's certificate. The connection process will then continue.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>xmpp</code></em> :</span></p></td>
<td>A <a class="link" href="InfXmppConnection.html" title="InfXmppConnection"><span class="type">InfXmppConnection</span></a>.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_xmpp_connection_certificate_verify_cancel ()">
<a name="inf-xmpp-connection-certificate-verify-cancel"></a><h3>inf_xmpp_connection_certificate_verify_cancel ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                inf_xmpp_connection_certificate_verify_cancel
                                                        (<em class="parameter"><code><a class="link" href="InfXmppConnection.html" title="InfXmppConnection"><span class="type">InfXmppConnection</span></a> *xmpp</code></em>);</pre>
<p>
Call this function when your callback set in
<a class="link" href="InfXmppConnection.html#inf-xmpp-connection-set-certificate-callback" title="inf_xmpp_connection_set_certificate_callback ()"><code class="function">inf_xmpp_connection_set_certificate_callback()</code></a> was called and you do not
trust the server's certificate. The connection will then be closed with a
corresponding error.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>xmpp</code></em> :</span></p></td>
<td>A <a class="link" href="InfXmppConnection.html" title="InfXmppConnection"><span class="type">InfXmppConnection</span></a>.
</td>
</tr></tbody>
</table></div>
</div>
</div>
<div class="refsect1" title="Property Details">
<a name="InfXmppConnection.property-details"></a><h2>Property Details</h2>
<div class="refsect2" title='The "credentials" property'>
<a name="InfXmppConnection--credentials"></a><h3>The <code class="literal">"credentials"</code> property</h3>
<pre class="programlisting">  "credentials"              <a class="link" href="libinfinity-0.4-InfCertificateCredentials.html#InfCertificateCredentials" title="InfCertificateCredentials"><span class="type">InfCertificateCredentials</span></a>*  : Read / Write / Construct Only</pre>
<p>The certificate credentials for GnuTLS.</p>
</div>
<hr>
<div class="refsect2" title='The "local-hostname" property'>
<a name="InfXmppConnection--local-hostname"></a><h3>The <code class="literal">"local-hostname"</code> property</h3>
<pre class="programlisting">  "local-hostname"           <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>*                : Read / Write / Construct Only</pre>
<p>The hostname of the local host.</p>
<p>Default value: NULL</p>
</div>
<hr>
<div class="refsect2" title='The "remote-hostname" property'>
<a name="InfXmppConnection--remote-hostname"></a><h3>The <code class="literal">"remote-hostname"</code> property</h3>
<pre class="programlisting">  "remote-hostname"          <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>*                : Read / Write / Construct Only</pre>
<p>The hostname of the remote host.</p>
<p>Default value: NULL</p>
</div>
<hr>
<div class="refsect2" title='The "sasl-context" property'>
<a name="InfXmppConnection--sasl-context"></a><h3>The <code class="literal">"sasl-context"</code> property</h3>
<pre class="programlisting">  "sasl-context"             <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>              : Read / Write / Construct Only</pre>
<p>The GnuSASL context used for authentication.</p>
</div>
<hr>
<div class="refsect2" title='The "sasl-mechanisms" property'>
<a name="InfXmppConnection--sasl-mechanisms"></a><h3>The <code class="literal">"sasl-mechanisms"</code> property</h3>
<pre class="programlisting">  "sasl-mechanisms"          <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>*                : Read / Write / Construct Only</pre>
<p>Whitespace separated list of SASL mechanisms to accept/offer.</p>
<p>Default value: NULL</p>
</div>
<hr>
<div class="refsect2" title='The "security-policy" property'>
<a name="InfXmppConnection--security-policy"></a><h3>The <code class="literal">"security-policy"</code> property</h3>
<pre class="programlisting">  "security-policy"          <a class="link" href="InfXmppConnection.html#InfXmppConnectionSecurityPolicy" title="enum InfXmppConnectionSecurityPolicy"><span class="type">InfXmppConnectionSecurityPolicy</span></a>  : Read / Write / Construct Only</pre>
<p>How to choose whether to use (or offer, as a server) TLS.</p>
<p>Default value: INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_TLS</p>
</div>
<hr>
<div class="refsect2" title='The "site" property'>
<a name="InfXmppConnection--site"></a><h3>The <code class="literal">"site"</code> property</h3>
<pre class="programlisting">  "site"                     <a class="link" href="InfXmppConnection.html#InfXmppConnectionSite" title="enum InfXmppConnectionSite"><span class="type">InfXmppConnectionSite</span></a>  : Read / Write / Construct Only</pre>
<p>Site of the connection (client or server).</p>
<p>Default value: INF_XMPP_CONNECTION_CLIENT</p>
</div>
<hr>
<div class="refsect2" title='The "tcp-connection" property'>
<a name="InfXmppConnection--tcp-connection"></a><h3>The <code class="literal">"tcp-connection"</code> property</h3>
<pre class="programlisting">  "tcp-connection"           <a class="link" href="InfTcpConnection.html" title="InfTcpConnection"><span class="type">InfTcpConnection</span></a>*     : Read / Write / Construct Only</pre>
<p>Underlaying TCP connection.</p>
</div>
<hr>
<div class="refsect2" title='The "tls-enabled" property'>
<a name="InfXmppConnection--tls-enabled"></a><h3>The <code class="literal">"tls-enabled"</code> property</h3>
<pre class="programlisting">  "tls-enabled"              <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>              : Read</pre>
<p>Whether TLS is enabled for the connection or not.</p>
<p>Default value: FALSE</p>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.15</div>
</body>
</html>